2005-04-08 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkimage.c (gtk_image_expose, gtk_image_calc_size):
+ If a stock_id is unknown, display the missing image. (#169870,
+ Steven Walter)
+
* gtk/gtkiconcache.c (icon_name_hash): Use the same function
as in updateiconcache.c. (spotted by Morten Welinder)
2005-04-08 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkimage.c (gtk_image_expose, gtk_image_calc_size):
+ If a stock_id is unknown, display the missing image. (#169870,
+ Steven Walter)
+
* gtk/gtkiconcache.c (icon_name_hash): Use the same function
as in updateiconcache.c. (spotted by Morten Welinder)
2005-04-08 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkimage.c (gtk_image_expose, gtk_image_calc_size):
+ If a stock_id is unknown, display the missing image. (#169870,
+ Steven Walter)
+
* gtk/gtkiconcache.c (icon_name_hash): Use the same function
as in updateiconcache.c. (spotted by Morten Welinder)
GdkBitmap *mask;
GdkPixbuf *pixbuf;
gboolean needs_state_transform;
+ GtkStockItem item;
+ gchar *stock_id;
+
image = GTK_IMAGE (widget);
misc = GTK_MISC (widget);
case GTK_IMAGE_PIXBUF:
image_bound.width = gdk_pixbuf_get_width (image->data.pixbuf.pixbuf);
- image_bound.height = gdk_pixbuf_get_height (image->data.pixbuf.pixbuf);
-
+ image_bound.height = gdk_pixbuf_get_height (image->data.pixbuf.pixbuf);
if (rectangle_intersect_even (&area, &image_bound) &&
needs_state_transform)
break;
case GTK_IMAGE_STOCK:
+ if (gtk_stock_lookup (image->data.stock.stock_id, &item))
+ stock_id = image->data.stock.stock_id;
+ else
+ stock_id = GTK_STOCK_MISSING_IMAGE;
pixbuf = gtk_widget_render_icon (widget,
- image->data.stock.stock_id,
+ stock_id,
image->icon_size,
NULL);
if (pixbuf)
{
GtkWidget *widget = GTK_WIDGET (image);
GdkPixbuf *pixbuf = NULL;
+ GtkStockItem item;
+ gchar *stock_id;
/* We update stock/icon set on every size request, because
* the theme could have affected the size; for other kinds of
switch (image->storage_type)
{
case GTK_IMAGE_STOCK:
+ if (gtk_stock_lookup (image->data.stock.stock_id, &item))
+ stock_id = image->data.stock.stock_id;
+ else
+ stock_id = GTK_STOCK_MISSING_IMAGE;
pixbuf = gtk_widget_render_icon (widget,
- image->data.stock.stock_id,
+ stock_id,
image->icon_size,
NULL);
break;